#include <algorithm>
#include <string>
using namespace std;

class Solution
{
public:
    static string solve(string s, string t)
    {
        string ret;
        int carry = 0;
        int cur1 = s.size()-1;
        int cur2 = t.size()-1;
        while(cur1>=0 || cur2>=0 || carry)
        {
            int num1 = cur1>=0 ? s[cur1]-'0' : 0;
            int num2 = cur2>=0 ? t[cur2]-'0' : 0;
            int sum = num1+num2+carry;
            carry = sum/10;
            ret += sum%10+'0';
            cur1--;
            cur2--;
        }
        reverse(ret.begin(), ret.end());
        return ret;
    }
};